<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="../../../WEB-INF/c.tld" prefix="c" %>

<!-- Partie ajout / modification d'un relai -->
<!-- Si nous avons cliqué sur AJOUTER, les champs seront vides et le bouton valider ajoutera le relai
     Si nous avons cliqué sur MODIFIER, les champs seront préremplis et le bouton valider modifiera le relai-->
     
<div class="dessousMenu">	
		
<div class="formCenter">	
		
	<div style="display: inline-block;" class="bTitre"><b>Formulaire relai</b></div>
	
	<div style="display: inline-block;" class="bouton"><a href="/IPIWeb/btnListeRelais.do"><img src="./images/retour.png"><b class="mTxtGauche">Retour</b></a></div>
	
	<html:form action="${action }" method="post"
			onsubmit="return validateRelaiForm(this);">
	
		<div class="divBleu">
		
		<html:hidden property="idRelai" value="${relai.id }"/>	
		<html:hidden property="idAdresse" value="${relai.address.id }"/>
			<table class="form">
		
				<tr>
					<td>
						Numéro du relai :
					</td>
					<td>
						<c:set var="i" value="${action}" />
						<c:set var="j" value="/update-relai-post.do" />
						
						<c:if test="${i eq j}">
							<input type="text" name="numeroRelai" size="16" disabled="disabled" maxlength="16" value="${relai.id }"/>
							<!-- + BOUTON GENERATION -->
							<a href=""><img src="./images/engrenage.png"></a>
						</c:if>
						<c:if test="${i ne j}">
							<input type="text" name="numeroRelai" size="16" maxlength="16" value="${relai.id }"/>
							<!-- + BOUTON GENERATION -->
							<a href=""><img src="./images/engrenage.png"></a>
						</c:if>
					</td>
				</tr>
				<tr>
					<td>
						Nom du relai :
					</td>
					<td>
						<input type="text" name="libelle" size="16" maxlength="16" value="${relai.name }"/>
					</td>
				</tr>
				<tr>
					<td>
						Numéro :
					</td>
					<td>
						<input type="text" name="numero" size="16" maxlength="16" value="${relai.address.number }"/>
					</td>
				</tr>
				<tr>
					<td>
						rue :
					</td>
					<td>
						<input type="text" name="adresse" size="16" maxlength="16" value="${relai.address.street }"/>
					</td>
				</tr>
				<tr>
					<td>
						Complément d'adresse
					</td>
					<td>
						<input type="text" name="complementAdresse" size="16" maxlength="16" value="${relai.address.complement }"/>
					</td>
				</tr>
				<tr>
					<td>
						Code postal
					</td>
					<td>
						<input type="text" name="codePostal" size="16" maxlength="16" value="${relai.address.postalCode }"/>
					</td>
				</tr>
				<tr>
					<td>
						Ville
					</td>
					<td>
						<input type="text" name="ville" size="16" maxlength="16" value="${relai.address.city }"/>
					</td>
				</tr>
			</table>

		</div>
			
		<div class="emplacement_bouton">
			<span class="bouton"><img src="./images/valider.png"><input type="submit" value="Valider" class="ok"/></span>
		</div>	
			
		<html:javascript formName="RelaiForm" />
		</html:form>
	
</div>
				
</div>